package com.baobao_jk.tutorialmod.blocks;

import java.util.Random;

import com.baobao_jk.tutorialmod.init.ModItems;

import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;

public class RubyOre extends BlockBase{

    public RubyOre(String name, Material material) {
        super(name, material);
        setSoundType(SoundType.METAL); //设置路过方块声音
        setHardness(5.0F); //设置硬度
        setResistance(15.0F); //设置爆炸抗性
        setHarvestLevel("pickaxe", 2); //设置获取工具
    }

    //若把以下代码删除，则会获得原方块
    @Override
    public Item getItemDropped(IBlockState state, Random rand, int fortune){
        return ModItems.RUBY; //返回物品
    }

    @Override
    public int quantityDropped(Random rand){
        return 1; //返回数量1
        //int max = 4; //最多获取数量
        //int min = 1; //最少获取数量
        //return rand.nextInt(max) + min; //随机数量
    }
}
